﻿using Ec.NETCoreFramework.Common.Clients;
using Ec.NETCoreFramework.Common.Core;
using Newtonsoft.Json.Linq;
using System;
using System.Collections.Generic;
using System.Web;

namespace Ec.NETCoreFramework.Common.Test
{
    public class Class1
    {
        private static string domain = "http://beta.366ec.net";
        public static void Main(string[] args)
        {


            //Test();
            //GetUserIdByMobile();
            DelSync();

        }
        static void Test()
        {
            Dictionary<string, object> dic = new Dictionary<string, object>()
            {
                {"Mobile","10691040513" },
                {"Name",HttpUtility.UrlEncode("虫儿飞") }
            };
            var appSecret = new RequestAppSecret();
            appSecret.AppId = "148fbe3a5d00218a";
            appSecret.Secret = "8daac14be0948fbb1a692a49e6bd1f0b";
            var _apiRequestClient = new ApiRequestClient(appSecret);
            var result = _apiRequestClient.GetResponse<string>("http://beta.366ec.net", "wxgroup.account.supplier.register", dic);
            var r = result.Result;
        }
        static void GetUserIdByMobile()
        {
            Dictionary<string, object> dic = new Dictionary<string, object>()
            {
                {"fk_id","1071" },
                {"db_id","53"},
                {"para",HttpUtility.UrlEncode("{\"2087\":\"15775976925\",\"2176\":\"15745859854\",\"2177\":\"13985845879\",\"2178\":\"15878595691\",\"2190\":\"15878959862\",\"2191\":\"15985652136\",\"2195\":\"16985845847\",\"2201\":\"10691031217\",\"2208\":\"18048671319\",\"2214\":\"10691007266\"}") }
            };
            var appSecret = new RequestAppSecret();
            appSecret.AppId = "148fbe3a5d00218a";
            appSecret.Secret = "8daac14be0948fbb1a692a49e6bd1f0b";
            var _apiRequestClient = new ApiRequestClient(appSecret);
            var result = _apiRequestClient.
                  GetResponse<JObject>("http://soul.366ec.net",
                  "bind_user_relation", dic, "/wx/bind_user_relation", null, 10000);
            var r = result.Result;
        }

        static void DelSync()
        {
            Dictionary<string, object> dic = new Dictionary<string, object>()
            {
                {"fk_id","1071" },
                {"db_id","53"},
                {"ManagerIds",HttpUtility.UrlEncode("2087,2222") }
            };
            var appSecret = new RequestAppSecret();
            appSecret.AppId = "148fbe3a5d00218a";
            appSecret.Secret = "8daac14be0948fbb1a692a49e6bd1f0b";
            var _apiRequestClient = new ApiRequestClient(appSecret);
            var result = _apiRequestClient.
                  GetResponse<JObject>("http://beta.366ec.net",
                  "wxgroup.account.manager.delsync", dic);
            var r = result.Result;
        }
    }
}
